﻿using System;

namespace HeroldIT.Dnn.JQuery
{
    /// <summary>
    /// An attribute for specifying under which value a field should be serialized.
    /// </summary>
    [AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = false)]
    public class SerializeAsAttribute : Attribute
    {
        #region properties

        /// <summary>
        /// Gets the name to serialize the field as.
        /// </summary>
        public object Value { get; private set; }

        #endregion

        #region constructors

        /// <summary>
        /// Creates a new <see cref="SerializeAsAttribute"/>
        /// </summary>
        /// <param name="value">The value to serialize the field as.</param>
        public SerializeAsAttribute(object value)
        {
            this.Value = value;
        }

        #endregion
    }
}
